Viewers can give your application added flexibility and power. This example book can be used to better understand viewer concepts and issues. You learn about viewer basics, displaying information using viewers, and controlling viewer properties. This example book also demonstrates viewer examples and describes troubleshooting tips.
9506161857182135672479341190
ASYM_TpID
what - bmp
ASYM_BeenHere
placeholder
9506161857282136709982477736
ASYM_TpID
Progress
ASYM_BeenHere
thermo
,"JdY
currentPercent
currentBar
fullBar
percentage
-- Set the
thermometer bar
-- Note that
uses
" property.
percentage
pPercentage
-- errror checking:
isType(real,
5 > 100
S < 0
"currentPercent"
& "%"
lWide
"fullBar"
"currentBar"
/ 100)
fullBar
currentBar
currentPercent
100%#
9506161857202135862480477680
ASYM_TpID
transparent
ASYM_BeenHere
placeholder
splash screen
ASYM_BeenHere
placeholder
MOONSOFT CORPORATION
Copyright Rocket Productions 1996
MOONSOFT CORPORATION
Copyright Rocket Productions 1996
9506161724281578654616762668
ASYM_TpID
Viewer - DB
ASYM_BeenHere
Try out the VBX Objects!
Buttonclick
Buttonclick
"Try out the VBX Objects!"
buttonClick
Really Cool!
ToolBook Is?
9506161724281578654616762668
ASYM_TpID
Viewer - Pal
ASYM_BeenHere
&Button
Viewer2
&Button
&Button
9506161724281578654616762668
ASYM_TpID
Viewer - Shadow
Viewers simply display pages of your application on the screen.
ASYM_BeenHere
ASYM_BeenHere
toolbar
ASYM_BeenHere
Using Viewersside to Multimedia
Using Viewersside to Multimedia
buttonClick
buttonClick
buttonClick
buttonClick
contents
buttonClick
buttonClick
"contents"
buttonClick
buttonClick
printing from a
PRINTWND.SBK -
Push this system book on to your sysBooks book property to print a window. Such as:
push "PRINTWND.SBK" onto sysbooks
Printing from a viewer
You cannot print directly from a viewer. However, there are two ways to get around this problem. You can print the contents of a viewer using the PRINTWND.SBK system book or print directly from the Main window.
Included with ToolBook is the PRINTWND.SBK system book. You can use this book to capture a viewer to the Clipboard and print it as a device independent bitmap. To use it, just push this system book onto your sysBooks stack on enterApplication or add it to the StartupSysBooks entry in the [ToolBook] section of the MTB30.INI. The Print Window menu item will be added to the File menu at Author level. Choose this command and a dialog box appears with several options, including which viewer to print.
The other option is to modify your print script to print in the main Window rather than in the viewer as shown in the example below. The screen is locked and ToolBook messages are suspended so none of the page switching is visible.
to handle buttonClick
sysLockScreen = true
sysSuspendMessage = true
oldPage = currentPage of mainWindow
currentPage of mainWindow = \
currentPage of this window
in mainWindow
set printerStyle to pages
set printerMargins to \
1440,1440,1440,1440
set printerGutters to 360,360
set printerScaling to custom
set printerBorders to true
set printerArrangement to 1,1
set printerPageBitmap to false
start spooler
print 1
end spooler
currentPage of mainWindow = oldPage
end buttonClickndow = oldPage
end buttonClickkinWindow = oldPage
end buttonClick
ASYM_BeenHere
endMarker
eenHere
endMarker
displaying the correct
ASYM_BeenHere
Each of your viewers must be assigned to a page. The page assigned to the viewer is specified in the Default Page field in the Viewer Properties dialog box. You can set the page associated with the viewer by changing the value in the Default Page field. If you assign a page that does not exist to a viewer, you will get an error message and your viewer will default to page 1. To make sure this error does not occur, make sure that the page exists and use the proper syntax when assigning the page. For example:
page id 16
page 4
page "Zoo Animals"
page 7 of book "c:\ships.tbk"
Default Page -
Be certain to assign a valid page to your viewer. If you do not, the viewer will display the first page of your book.
Default Page of a viewer
working with memory
ASYM_BeenHere
You should close a viewer as soon as you are done using it. Each open viewer uses memory resources, regardless of whether the viewer is shown or hidden. Hiding a viewer is not the same as closing the viewer. A hidden viewer will take up memory as well.
There is a 32-instance limit on opening and closing viewers in one script (a single handler and any other handlers that it calls). This limit applies to opening and closing the same viewer repeatedly, or opening and closing up 32 separate viewers.
Viewer tip -
Close viewers that are hidden to free memory resources.
y resources.
d of your viewer.
2 Image Buffer -
A buffer is created for the background and page of your viewer.
Memory and viewers
Displaying a progress
ASYM_BeenHere
Besides using a viewer to display a dialog box, a page from another book, or a tool palette, you can use a viewer to display the progress of an event in ToolBook. Click the Progress Bar Viewer button for an example.
.'+ +F
,&H.&
.'+ +F
Progress
thermo
percentage
buttonClick
progress cursor
buttonClick
vRef
"Progress"
-- initialize the thermometer
percentage
--
--
currentPage
close
stretchBitmap
Progress Bar Viewer
Progress bar
Creating a transparent
ASYM_BeenHere
When you use a transparent viewer, you would be able to see any objects that reside behind the viewer. A transparent viewer can easily be created without resorting to Windows API (Application Programming Interface) calls. Instead, you can set the properties of the viewer to none. For example:
pattern of background "transparent" = none
Click on the Open Transparent Viewer button to display a transparent viewer.
.'+ +F
.'+ +F
Transparent Viewer
Viewer Place
buttonClick
buttonClick
"Transparent Viewer"
" = pageUnitsToScreen(
* Place",
%notActive
Open Transparent Viewer
viewer place
Viewer exampley
Transparent Viewer
buttonClick
buttonClick
isOpen
"Transparent Viewer"
close
Close Transparent Viewer
Transparent viewers
Using the imageCommand
ASYM_BeenHere
The imageCommand() controls the display of external graphic files in a child, popup, or overlapped window. This function works in a way similar to
the callMCI() function when it is used to control animation devices.
-$, #?
bmpVar
TB40DLG.DLL
play bmpImage drip fast wait
alias bmpImage style child parent
filterList
openFileDlg
ImageCommand
openFileDlg
Bitmap (*.bmp),*.bmp
Choose bitmap image...
buttonClick
buttonClick
linkDLL "TB40DLG.
STRING openFileDlg(
,INT)
filterList = "Bitmap (*.bmp),*.
F"Choose bitmap image...",
bmpVar =
4-- User Canceled
"ImageCommand"
imageCommand("
" &&
\&& "alias bmpImage style child
" && clientHandle
] && "wait")
gplay
Mdrip
Show image in viewer
ImageCommand
close bmpImage wait
buttonClick
buttonClick
imageCommand("close bmpImage wait")
isOpen
"ImageCommand"
Close image in viewer
Using imageCommand() with a viewer
Scrolling and magnifying
ASYM_BeenHere
Both viewers to the right are viewing the same page, however, each viewer appears to be looking at a different page because each viewer has unique page-scroll values.
Click the Zoom buttons to show and magnify the viewers.
Click the viewers to see the horizontal and vertical page-scroll positions in the fields below the viewers. Note that the horizontal and vertical units displayed in the fields are in ToolBook page units.3
Example - Scroll2
Example - Scroll1
leavePage
notifyBefore
isOpen
"Example - Scroll1"
close
Show viewers
.'+ +F
.'+ +F
Scroll Example Page
Example - Scroll2
Example - Scroll1
buttonClick
Example - Scroll2
Example - Scroll1
leavePage
buttonClick
"Example - Scroll1"
sysOpenWindows
8 = pageUnitsToScreen(
-- pageScroll
n = 3000,2000
2" =
2" =
B"2"
Page"
notifyBefore
close
Show viewers
Horizontal:
horizontal
Vertical:
vertical
false
Scroll Example Page
close
Example - Scroll1
show viewers
buttonClick
buttonClick
isOpen
"Example - Scroll1" =
viewers"
normalGraphic
= icon "close"
B"1" \
Page"/2), (
B"1" \
sfar"
false
Scroll Example Page
close
Example - Scroll2
show viewers
buttonClick
buttonClick
isOpen
"Example - Scroll2" =
viewers"
normalGraphic
= icon "close"
B"2" \
Page"*.75), (
B"2" \
ufar"
pageScroll
B"2"
disabled
.'+ +F
.'+ +F
Magnify
buttonClick
buttonClick
"Magnify"
Magnify Example
Scrolling and magnifying a viewer
leavePage
Creating a full
ASYM_BeenHere
You may not know what resolution your application will be viewed at. You can create a full-screen viewer to make your application more professional-looking and allow the user to focus on the intended material more effectively.
Click on the viewer example to the right to display a full screen viewer.
LockWindowUpdate
lockWindowUpdate
,$T92O
getDeskTopWindow
example - full
GetDeskTopWindow
lockWindowUpdate
buttonClick
buttonClick
linkDLL "user"
INT lockWindowUpdate(WORD)
getDeskTopWindow()
LockWindowUpdate(GetDeskTopWindow())
"example - full"
state
! = maximized
sizeToViewer
Viewer
Example
(click-here))
Full screen
creating a splash
splash screen
false
vTimer
seconds
hTime
splash screen
enterPage
splash screen
leavePage
4vTimer, hTime
+ 5 <
isOpen
"splash screen"
close
When you enter your application often you may wish to display a splash screen, such as a bitmap which includes the name of the application and the developers. Viewer work very well as splash screens.
splash screen
vTimer
hTime
buttonClick
buttonClick
4vTimer, hTime
"splash screen"
statusText
popHelpText
Show splash screen viewer
Splash screen
Creating a transparent
ASYM_BeenHere
When you use a transparent viewer, you would be able to see any objects that reside behind the viewer. A transparent viewer can easily be created without resorting to Windows API (Application Programming Interface) calls. Instead, you can set the properties of the viewer to none. For example:
pattern of background "transparent" = none
Click on the Open Transparent Viewer button to display a transparent viewer.
.'+ +F
.'+ +F
Transparent Viewer
Viewer Place
buttonClick
buttonClick
"Transparent Viewer"
" = pageUnitsToScreen(
* Place",
%notActive
Open Transparent Viewer
viewer place
Viewer exampley
Transparent Viewer
buttonClick
buttonClick
isOpen
"Transparent Viewer"
close
Close Transparent Viewer
Transparent viewers
Pages of other books
Using the 'in'
ASYM_BeenHere
The focus can be in only one viewer at a time. You may want to execute a command in another viewer, you can use the 'in' control structure. For example, if you are on page one in viewer ID 1 but want to execute a command on page two in viewer ID 2, you would use the 'in' control structure to change the target window to the specified viewer declared in the control structure and executes each statement within the context of that viewer.
The example shows how to hide the field "birds" on page two being show in viewer ID 2 from a script on page one being shown in viewer ID 1. When ToolBook is done executing the control structure, the target window gets set back to the original viewer.
In Viewer' -
to handle buttonClick
in viewer "two"
hide field "birds"
end in
end buttonClick
ckground of your viewer.
2 Image Buffer -
A buffer is created for the background and page of your viewer.
Using the 'in' control structure
Using modal viewers
ASYM_BeenHere
A modal viewer allows no actions to be taken outside of the viewer until it is closed. For example, if you want the user to read information or answer a question before proceeding you should use a modal viewer. Most standard Windows dialog boxes are modal. Below is an example script you can use to display a modal viewer:
to handle buttonClick
open viewer "navigate" as modal
end buttonClick
Modal -
No actions can be taken outside the viewer until the viewer has been closed.
ted for the background of your viewer.
2 Image Buffer -
A buffer is created for the background and page of your viewer.
Modal viewers
Using image buffers
Image buffers
0 Image Buffers -
Objects are drawn directly to your viewer.
1 Image Buffer -
A buffer is created for the background of your viewer.
2 Image Buffer -
A buffer is created for the background and page of your viewer.
background and page of your viewer.
ASYM_BeenHere
Image buffers is a persistent property of all viewers. The image buffers property of a viewer has three possible settings, 0, 1 and 2.
0 - ToolBook doesn't create any image buffers for a viewer. This option uses the least amount of memory. It is typically fast in situations where there is one page per background. This setting also overrides the drawDirect property of any object on the page or background, and forces objects to behave as if the drawDirect property was set to true
1 - ToolBook creates one image buffer for the viewer that is used for the background. Use this setting if your application uses several backgrounds with duplicate pages.
2 - ToolBook creates an image buffer for the page and the background. Although this setting can cause the slowest page display and requires the most memory, it results in the smoothest display. Use this setting if you have animated ToolBook objects and you don't want a lot of flickering.
If objects are flashing in a viewer as a result of moving or showing and hiding objects, change the setting of the image buffers property of the viewer from 0 to 1. This causes ToolBook to compose the window image in memory before displaying it instead of drawing each object onscreen directly.
To set the image buffers property of the viewer, open the Viewer Properties dialog box, click the Options tab, image buffers combo box. You can also use OpenScript to set this property. For example:
imageBuffers of viewer "dialog 1" = 1
Viewing pages
ASYM_BeenHere
You can use a viewer to view pages of your current book or pages of another book.
When you open a viewer that views a page of another book you activate the enterBook, enterPage and enterBackground handlers.
Book:
bookVar
ToolBook (*.tbk),*.tbk
filterList
openFileDlg
TB40DLG.DLL
Choose book to view...
openFileDlg
Example - page
buttonClick
mouseEnter
buttonClick
linkDLL "TB40DLG.
STRING openFileDlg(
,INT)
filterList = "ToolBook (*.tbk),*.
H"Choose
view...",
bookVar =
4-- User Canceled
8" =
"Example -
sysOpenWindows
currentPage
" = pageUnitsToScreen(
Viewer
Example
(click-here)
Pages of other books
notifybefore
"0,0"
"0,0"
moved
ssm = sysSuspendMessages
notifyBefore ASYM_Reset
{loc;
buttonClick
rightButtonClick
a buttonClick handler
use a single
update
-- the
rather than having a continuous
loc =
linkDLL "TB40WIN.
INT xUnitsFromPixels(
yUnitsFromPixels(
isOpen
"mag" =
find
xCenter = (
yCenter = (
-- calculate
units
xMouseCenter =
yMouseCenter =
]> 0
pageScroll
close
--closeWindow Sent
closed.
--enterMenu
displayed.
--enterWindow
--hidden
--leaveWindow
loses the
--menuItemSelected
user chooses a
--moved
repositioned.
--openWindow
opened.
--pageScrolled
indicate how far a
been scrolled.
--shown
--sized
resized.
--stateChanged
minimized, restored,
maximized.
" & CRLF
"messages"
notifyBefore
"0,0"
"0,0"
moved
ssm = sysSuspendMessages
ASYM_Reset
{loc;
buttonClick
rightButtonClick
Copyright
1995
Asymetrix Corporation
gives you permission
e, revise,
reuse the
individual
scripts
your own
applications.
You may
J entire
substantial part
redistribution
b product.
retains
copyright on
original elements
. Include
notice "Portions
are
contain
copied
Author: Terry Lee
Erik Reitan
Last revision: 10/31/95
"waveAudio"
sysSupportedMedia
"Wave
' driver
xfound!"
sysPageUnitsPerPixel = 12
el = 12
defaultState
= maximized
maximumSize
= 640,480
= 640,480
"Tool Bar"
statusBar
sizeToViewer
captionBar
leavePage
Viewers and the object hierarchy
ASYM_BeenHere
As a ToolBook developer you must understand how script within a viewer is processed. The script within an object is divided into handlers, such as a buttonClick handler. When an action takes place, such as a button being clicked, any handlers for messages associated with the action are executed. The handlers must exist in the script of objects up the ToolBook Object Hierarchy. The ToolBook object hierarchy provides the order that a message progress.
Background Containing the Page pages as well as other objects
ToolBook System
Viewer
Viewers and the object hierarchy
Choosing options of
ASYM_BeenHere
To set the behavior of a viewer, use the Options tab of the viewer Properties dialog box.
You can set the default state of the viewer to Normal, Maximized, Minimized, or Lock Minimized (permanently minimized). You can:
Set image buffers to 0, 1, and 2.
Auto Show lets you specify that the viewer is automatically shown when the book opens.
Hide On Deactivate specifies that the viewer is hidden when the ToolBook instance is deactivated or another application is active.
Always Reader Level specifies that the viewer operates as if in Reader level, regardless of the system level setting for the rest of the application.
Close On Button Click specifies that the viewer closes when the user clicks the mouse anywhere on screen or presses any key.
Always On Top specifies that the viewer will remain on top, regardless of whether other windows or objects are active.
Center Client specifies that when the viewer is first opened, it is in the center of the current window.
Revert Focus specifies that when returning to the top level, ToolBook reverts the focus to the window or viewer that previously held the focus.
Author Status Bar displays a status bar in the viewer at Author level.
Reader Status Bar displays a status bar in the viewer at Reader level.
Viewer options
Default Sate:
Style:
Border Style
Normal
Caption Bar
Windows Colors
A&uto Show
Minimize Box
Hide on Deactivate
Position
Limits
Options
Windows Colors
Al&ways on Top
Windows Colors
Close on Button Clic&k
Windows Colors
Always &Reader Level
Minimize Box
Au&thor Status Bar
Minimize Box
&Center Client
Windows Colors
R&eader Status Bar
Windows Colors
Revert Focus
Image Buffers:
$o c$
$o c$
Optionssoperties
viewer messages
ASYM_BeenHere
Viewers have their own set of messages.
Message and Description
closeWindow -
Sent to a viewer when it is closed.
enterMenu -
Sent to a viewer when it is displayed.
enterWindow -
Sent to a viewer when it is activated.
hidden -
Sent to a viewer when it is hidden.
leaveWindow -
Sent to a viewer when it loses the focus.
menuItemSelected -
Sent to a viewer when the user chooses a menu item.
moved -
Sent to a viewer when it is repositioned.
openWindow -
Sent to a viewer when it is opened.
pageScrolled
Sent to a viewer to indicate how far a page has been scrolled.
shown -
Sent to a viewer when it is shown.
sized -
Sent to a viewer when it is resized.
stateChanged -
Sent to a viewer when it is minimized, restored, or maximized.
.'+ +F
.'+ +F
Example - messages
buttonClick
Example - messages
leavePage
buttonClick
"Example - messages"
" = pageUnitsToScreen(
notifyBefore
isOpen
close
Viewer
Example
(click-here)
messages
EnterPage
notifyBefore EnterPage
Viewer messsages
EnterPage
leavePage
Restricting navigation
ASYM_BeenHere
Every viewer must show a page. However, a page does not have to be displayed when using normal navigation. When the skipNavigation page property is set to true, ToolBook will skip that page when using the send next and send back messages. The only way to get to this page at reader level is to use the go command. For example:
go to next page
SkipNavigation has no effect when navigating through a book at Author level.
SkipNavigation -
When this page property is set to true, ToolBook will skip that page when using the send next and send back messages.
Note: The viewers in this book can't be navigated to at reader level because the skipNavigation property is set to true.
set to true.
Restricting navigation
Current Size
Caption Bar
Pixles
10240
Units:
System Menu
Non&e
Width:
Height::::::
System Menu
Non&e
Width:
Height::::::
Maximum Size
Minimum Sizee
Limitssroperties
Setting the Size
ASYM_BeenHere
Viewer size
You can use the Size tab in the Viewer Properties dialog box to set the size of the viewer. By default, when you create a viewer, it will be the size of the page that it is assigned to. If you turn Auto Size off, you can set the default client size of the viewer. If you choose to customize the size of the viewer, the units available for setting the size are Pixels, Page Units, Inches, and Centimeters.
Style:
Position
Limits
Options
Style:
Position
Limits
Options
Width:
Height::::::
Units:
$o c$
$o c$
Current Size
Caption Bar
Page Untis
Non&e
Size To Pa&ge
&Custom
System Menu
Au&to size
Default Client Size
Sizee properties
Selecting the Position
ASYM_BeenHere
To customize the placement of a viewer, use the Position tab in the viewer Properties dialog box. If the viewer is a child viewer, you can tile it in relation to the main viewer: Left, Top, Right, Bottom, or None. The default position of the viewer can be None, Center, or Custom. If you choose to customize the position of the viewer, the units available for setting the position are Pixels, Page Units, Inches, and Centimeters. A preview area shows you the position of the viewer in relation to the screen.%
Tile:
Style:
l D i
Limits
Options
X Pos:
Default Position
Y Pos:
Units:
Position
$o c$
$o c$
Caption Bar
Caption Bar
Pixles
Pixles
Non&e
Cente&r
&Custom
Current Position
Viewer position
Positionn
Choosing the Style
ASYM_BeenHere
You can use the options in the Style tab of the Viewer Properties dialog box to set a viewer's appearance. You can set the border style to None, Thin Frame, Thick Frame, Dialog Frame, or Shadowed. The caption bar can be set to Normal, Thin or none. Text can be assigned to the viewer that will appear in the caption bar when the viewer is open. You can also have a System Menu, Minimize and Maximize Boxes, and Scroll Bars on a viewer.
Border Style:
Mat Color
Ma&t Color...
Style:
Caption Bar:
Caption Text::
Caption Text
Border Style
Thin Framee
Popup
Caption Bar
Normal
Popup
Windows Colors
Use &Windows Colors
Minimize Box
Minimize Bo&x
Maximize Box
Maximize Bo&x
Scrolling
Scrollin&g
Sample:Name:
Position
Limits
Options
System Menu
System Men&u
$o c$
$o c$
Style properties
Style properties
Types of viewers
ASYM_BeenHere
There is a distinction between the style of a viewer and the type of viewer. Common viewer styles include dialog boxes and tool palettes, viewer type can be either child or popup. A child viewer is a window that is contained within the parent window, which in most cases will be your Main ToolBook window, viewer ID 0. A popup window is a separate window that floats on top of its parent window.
Child viewer -
A child window is contained within and clipped by its parent window (most frequently this is the ToolBook main window referred to as viewer id 0).
Popup viewer -
A popup window is a separate window that floats on top of its parent window.
Child Viewer
Main Window
Popup Viewer
Types of viewers
What a viewer displays
ASYM_BeenHere
The most common use of a viewer is to display a page from the current book or another book. Advanced OpenScript programmers can use viewers to display other Windows applications or media effects, such as NotePad or a bitmap. When you first create a viewer you can assign a page to the viewer, although the default is to automatically create and assign a new page and background. If you assign an invalid page, ToolBook will default to the first page of the book.
.'+ +F
.'+ +F
What viewer displays NotePad
buttonClick
buttonClick
"What
displays NotePad"
%notActive
&= pageUnitsToScreen(
Viewer Example (click-here)
.'+ +F
.'+ +F
What viewer displays Bitmap
buttonClick
What viewer displays Bitmap
What viewer displays Notepad
leavePage
buttonClick
"What
displays Bitmap"
%notActive
%= pageUnitsToScreen(
notifyAfter
isOpen
close
Notepad" =
Viewer Example (click-here))))))))
What a viewer displays
leavePage
The components of a viewer
Viewers have many properties, such as style and size. You can combine viewer properties to create different types of viewers, such as:
Dialog boxes
Palettes
Read-only popup boxes
Viewers consist of several components:
System bar
System menu
Caption
Minimize and Maximize buttons
Boarder and Status Bar
You can set viewer properties in the Viewer Properties dialog box.
Multimedia ToolBook - (Untitled)
2 of 2
Page 2
Status barnnnnnnn
Minimize buttonnn
System menuurionn
Borderrbarnnnnnnn
Maximize buttonnn
Caption barrrionn
Components of a viewer
ASYM_BeenHere
What are viewers
You can use a viewer for a variety of purposes, such as displaying a dialog box, progress bar, or page from your current book or another book. Viewers display pages of your application onscreen.
The ToolBook Main window is the default viewer. This window is automatically displayed when you open a new application. However, you can create additional viewers and assign them pages to display.
Only one page can be displayed at a time in a viewer. However, you can display several viewers simultaneously and assign each one to display a different page.
Viewer2
Viewer1
Viewer - Shadow
Viewer3
Viewer - Pal
Viewer2
Viewer - DB
Viewer1
enterPage
Viewer - Shadow
Viewer - Pal
Viewer - DB
leavePage
notifyAfter
"Viewer - DB"
%notActive
= pageUnitsToScreen(
"Viewer1",
LPal"
"Viewer2",
Shadow"
"Viewer3",
focusWindow =
isOpen
close
viewer3
What are viewers
enterPage
leavePage
ASYM_BeenHere
firstIdle
firstIdle
sizeToViewer
Creating, opening and
showing vi
ASYM_BeenHere
To create a viewer, choose Viewer from the Object menu. Click the New button within the Viewers dialog box to create a new viewer. ToolBook gives you the option of choosing a pre-defined viewer or creating your own. To customize your viewer, click the Properties button of the Viewer dialog box. In the Viewer Properties dialog box, select the options you want, such as the size, position, and limits, then click OK to close the Viewer Properties dialog box.
There are two ways to open and show a viewer. You can open a viewer from the Viewer dialog box using the interface, or use script. Below is an example script that opens and shows a viewer named "navigate":
to handle buttonClick
open viewer "navigate"
show viewer "navigate"
end buttonClick
Note that you can open a viewer without showing it. For example, you may want to open a viewer when entering the page but not show it until the user clicks a button on the page. The advantage is it takes less time for the viewer to be displayed because it is already open.
Create a viewer -
to handle buttonClick
new viewer
name of it = "test"
defaultPage of viewer "test" = \
last page of this book
defaultType of viewer "test" = popup
end buttonClick
Creating, opening and showing viewers
95061618114018618533250196500
ASYM_TpID
enterPage
leavePage
ASYM_BeenHere
Contents
Section Title 1
Viewer basicss
Section List 1
tempName
buttonClick
buttonClick
tempName =
What are viewers
The components of a viewer
What a viewer displays
Types of viewers
Viewers and the object hierarchy
Viewer messagess Viewer messages
Section List 2
tempName
buttonClick
buttonClick
tempName =
Creating, opening and showing viewers
Restricting navigation
Using image buffers
Using modal viewers
Using the 'in' control structuree
Section List 3
tempName
buttonClick
buttonClick
tempName =
Choosing the style of a viewer
Selecting the position of a viewer
Setting the size of a viewer
Defining limits of a viewer
Choosing options of a viewerr
Section List 4
tempName
buttonClick
buttonClick
tempName =
Viewing pages
Creating a splash screen viewer
Creating a full screen viewer
Scrolling and magnifying a viewer
Creating a transparent viewer
Displaying a progress bar viewerring a progress bar Viewer
Viewers can give your application added flexibility and power. Reviewing this book can help you better understand viewer concepts and issues. You will learn about the basics of using viewers, displaying information in viewers, and controlling viewer properties. This book also provides examples of viewers and offers troubleshooting tips.
Intro
9507251716271924423826373122
ASYM_TpID
Backdrop
_ASYMA_LockMove
buttonClick
buttonStillDown
enterPage
buttonClick
J"info" <> 0
enabled
B"down"
textUnderFlow
notifyBefore
buttonStillDown
enterPage
buttonClick
buttonClick
notifyBefore
textOverFlow
J"info" = 0
enabled
B"up"
enterPage
ASYM_Reset
Defining Limits of
ASYM_BeenHere
You can use the Limits tab of the viewer Properties dialog box to set the maximum and minimum sizes of the viewer. When you set the maximum and minimum size of the viewer, using the Maximize and Minimize buttons will change the viewer size to what has been specified in the maximum size and minimum size boxes. If you choose to customize the size of the viewer, the units available for setting the size are Pixels, Page Units, Inches, and Centimeters.